package com.supermap.rootstock.data.source;

import com.supermap.rootstock.common.core.utils.R;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author aqua
 * @description
 * @date 2019年09月25 17:02
 * @email 1301584033@qq.com
 */
@Slf4j
@AllArgsConstructor
@Service
public class SourceConfigServiceImpl implements  SourceConfigService {
	private final  SourceConfigMapper sourceConfigMapper;
	@Override
	public R getDataBase() {
		return new R(sourceConfigMapper.getDataBase());
	}

	@Override
	public R getDatatSourceConfig(Integer userId) {
		return new R(sourceConfigMapper.getDatatSourceConfig(userId));
	}

	@Override
	public R puttDatatSourceConfig(DataSource dataSource) {
		return new R(sourceConfigMapper.puttDatatSourceConfig(dataSource));
	}

	@Override
	public R delDatatSourceConfig(Integer id) {
		return new R(sourceConfigMapper.delDatatSourceConfig(id));
	}
}
